package com.baizhi.service.impl;

import com.baizhi.dao.LogDao;
import com.baizhi.entity.Log;
import com.baizhi.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class LogServiceImpl implements LogService {

    @Autowired
    private LogDao logDao;

//    查询所有日志记录  分页查询
    @Override
    public Map listLog(int page, int limit,String logContent, String logType) {
        int start=(page-1)*limit;
        List<Log> listLog = logDao.listLog(start,limit,logContent,logType);
        int count = logDao.countLog(logContent,logType);
        Map map=new HashMap();
        map.put("data",listLog);
        map.put("count",count);
        map.put("code",0);
        map.put("msg","");
        return map;
    }


}
